#!/usr/bin/perl
# 
#  Exercise 7.2 
# 
# Write a program that picks one of the four nucleotides and then keeps prompting 
# until you correctly guess the nucleotide it picked.
#
# Answer to Exercise 7.2

my @bases = qw(A C G T);

srand(time|$$);

my $pick = $bases[rand @bases];

print "Guess which nucleotide I picked!: ";

my $guess = <STDIN>;
chomp $guess;

until( $guess eq $pick ) {
	print "Guess again: ";

	$guess = <STDIN>;
	chomp $guess;
}

print "Yes!! I did pick $pick!!\n";

exit;
